  <button class="btn btn-primary btn-sm dropdown-toggle drilldownbutton" ng-disabled="view.params.mode == 'facts'" type="button" data-toggle="dropdown" data-submenu>
    <i class="fa fa-fw fa-arrow-down"></i> <span class="hidden-xs" ng-class="{ 'hidden-sm hidden-md': cvOptions.studioTwoColumn }">Drilldown</span> <span class="caret"></span>
  </button>

  <ul class="dropdown-menu dropdown-menu-right cv-view-menu-drilldown">

      <!-- if ((grayout_drill) && ((($.grep(view.params.drilldown, function(ed) { return ed == dimension.name; })).length > 0))) { -->
      <li on-repeat-done ng-repeat-start="dimension in view.cube.dimensions" ng-if="dimension.levels.length == 1" ng-click="selectDrill(dimension.name, true);">
        <a href="">{{ dimension.label }}</a>
      </li>
      <li ng-repeat-end ng-if="dimension.levels.length != 1" class="dropdown-submenu">
        <a tabindex="0">{{ dimension.label }}</a>

        <ul ng-if="dimension.hierarchies_count() != 1" class="dropdown-menu">
            <li ng-repeat="(hikey,hi) in dimension.hierarchies" class="dropdown-submenu">
                <a tabindex="0" href="" onclick="return false;">{{ hi.label }}</a>
                <ul class="dropdown-menu">
                    <li ng-repeat="level in hi.levels" ng-click="selectDrill(dimension.name + '@' + hi.name + ':' + level.name, true)"><a href="">{{ level.label }}</a></li>
                </ul>
            </li>
        </ul>

        <ul ng-if="dimension.hierarchies_count() == 1" class="dropdown-menu">
            <li ng-repeat="level in dimension.default_hierarchy().levels" ng-click="selectDrill(dimension.name + '@' + dimension.default_hierarchy().name + ':' + level.name, true)"><a href="">{{ level.label }}</a></li>
        </ul>

      </li>

      <div class="divider"></div>

      <li ng-class="{ 'disabled': view.params.drilldown.length == 0 }" ng-click="selectDrill('')"><a href=""><i class="fa fa-fw fa-close"></i> None</a></li>

  </ul>

